home *** CD-ROM | disk | FTP | other *** search
/ Multimedia Dogs / Multimedia Dogs v2.0.iso / mac / Extras / MMDogs 2.0 with Desktop / MMDOGS2.DXR / 00274_Shortcut handlers.ls < prev    next >
Encoding:
Text File  |  1995-10-09  |  1.4 KB  |  61 lines

  1. on castNameOfSprite whichSprite
  2.   return the name of cast the castNum of sprite whichSprite
  3. end
  4.  
  5. on castNumOfSprite whichSprite
  6.   return the castNum of sprite whichSprite
  7. end
  8.  
  9. on relink whichCast, newFilename
  10.   if the fileName of cast whichCast <> newFilename then
  11.     putDebug("Relinking cast" && whichCast && "to" && newFilename)
  12.     set the fileName of cast whichCast to newFilename
  13.   else
  14.     putDebug("Skipping relink of cast" && whichCast && "to" && newFilename)
  15.   end if
  16. end
  17.  
  18. on showSprite whichSprite
  19.   set the visible of sprite whichSprite to 1
  20. end
  21.  
  22. on hideSprite whichSprite
  23.   set the visible of sprite whichSprite to 0
  24. end
  25.  
  26. on showAllSprites
  27.   repeat with i = 1 to 48
  28.     set the visible of sprite i to 1
  29.   end repeat
  30. end
  31.  
  32. on hideAllSprites
  33.   repeat with i = 1 to 48
  34.     set the visible of sprite i to 0
  35.   end repeat
  36. end
  37.  
  38. on disableAllPuppets
  39.   repeat with i = 1 to 48
  40.     safePuppetSprite(i, 0)
  41.   end repeat
  42. end
  43.  
  44. on safePuppetSprite theSprite, theBoolean
  45.   if (theBoolean = 1) and (the castNum of sprite theSprite = 0) then
  46.     alert("Attempt to puppet unpopulated sprite" && theSprite && "at frame" && the frame)
  47.     exit
  48.   end if
  49.   puppetSprite(theSprite, theBoolean)
  50. end
  51.  
  52. on moveSpriteOffstage whichSprite
  53.   if the castNum of sprite whichSprite = 0 then
  54.     exit
  55.   end if
  56.   safePuppetSprite(whichSprite, 1)
  57.   set the locH of sprite whichSprite to -1000
  58.   updateStage()
  59.   safePuppetSprite(whichSprite, 0)
  60. end
  61.